Duplicated Code In Conditional ^^^^^ **Definition:** * The duplicated code can appear in a series of conditionals (with different conditions and the same action in each check) or in all legs of a conditional **Code Example:** .. code-block:: java function checkSomething(in float p1, in float p2) return boolean { if (p1 < 0.0) { return false; } if (p2 >= 7.0) { return false; } if (p2 < p1) { return false; } return true; } function checkSomethingElse(in float p1) runs on ExampleComponent { var charstring result; if (p1 > 0) { result := "foo"; pt.send(result); } else { result := "bar"; pt.send(result); } } **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `An approach to quality engineering of TTCN-3 test specifications `_ * `Pattern-based Smell Detection in TTCN-3 Test Suites `_ :octicon:`file-code;1em` :octicon:`comment-discussion;1em` :octicon:`sync;1em` * `Utilising Code Smells to Detect Quality Problems in TTCN-3 Test Suites `_